package Practice.object;

public class MatchesDemo {
    public static void main(String[] args) {



        String   email = "baizhi07@gmil.com";
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)";//   \\.[a-zA-Z]+ 表示邮箱后缀格式,,(\.[a-zA-Z]+)表示有一个或多个后缀
        boolean b = email.matches(regex);
        System.out.println(b?"输入邮箱格式正确":"输入邮箱格式错误");



    }
}
